[Model] Skip unused Jina V5 output layers - #52037
Merged
noooop merged 2 commits intoAug 13, 2026
Merged
Conversation
Co-authored-by: Codex <noreply@openai.com> Signed-off-by: kiroxu <148877251+BabyDrangoner@users.noreply.github.com>
BabyDrangoner
marked this pull request as ready for review
August 12, 2026 19:03
noooop
reviewed
Aug 13, 2026
Co-authored-by: Codex <noreply@openai.com> Signed-off-by: kiroxu <148877251+BabyDrangoner@users.noreply.github.com>
noooop
approved these changes
Aug 13, 2026
noooop
left a comment
Collaborator
There was a problem hiding this comment.
Thanks for your contribution.
noooop
enabled auto-merge (squash)
August 13, 2026 02:32
Collaborator
|
/ci run |
|
✅ Triggered Buildkite CI #83653 for commit |
Contributor
Author
|
/ci run |
|
✅ Triggered Buildkite CI #83673 for commit |
zyp2014
pushed a commit
to zyp2014/vllm
that referenced
this pull request
Aug 21, 2026
Signed-off-by: kiroxu <148877251+BabyDrangoner@users.noreply.github.com> Co-authored-by: Codex <noreply@openai.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
Jina Embeddings V5 models are pooling-only, but their vLLM wrappers inherit
causal-LM classes. Because these wrappers already declare themselves as pooling
models, they bypass the generic pooling adapter that replaces generation-only
output layers. The encoder/nano variant therefore retained an unused
ParallelLMHeadwith shape[128256, 768].This change applies the existing pooling-model
no_init_weightspattern toboth Jina V5 wrappers, replacing
ParallelLMHeadandLogitsProcessorwith aStageMissingLayer. The decoder/small checkpoint ties its output head to theinput embedding (
VocabParallelEmbedding), so that shared embedding remainsintact.
On an NVIDIA RTX PRO 6000 Blackwell (TP=1), the nano checkpoint's loaded model
state changed as follows:
lm_headbytesThis removes 187.875 MiB of resident parameters (31.75%) and approximately
188 MiB of post-load CUDA memory. This is a resident-memory result; it is not a
claim that the transient module-construction peak is eliminated.
I searched open vLLM PRs and issues for Jina V5/Embeddings V5 combined with
lm_head, output-layer, and pooling terms and found no direct or semanticduplicate. #32757 is the already-merged generic pooling mechanism used as the
implementation precedent, not another Jina-specific fix.
AI assistance (OpenAI Codex) was used to help investigate, implement, and test
this change. I reviewed the complete diff and the validation results.
Test Plan
jinaai/jina-embeddings-v5-text-nanocheckpoints; compare parameter andpost-load CUDA memory plus float32 embedding bytes.
jinaai/jina-embeddings-v5-text-smallto cover its tied embedding.pre-commit hooks applicable to the changed production file.
Commands:
.venv/bin/python -m pytest -q \ tests/models/language/pooling/test_jina_embeddings_v5.py \ tests/models/test_adapters.py \ 'tests/models/test_registry.py::test_registry_imports[JinaEmbeddingsV5Model]' uvx pre-commit run --files \ vllm/model_executor/models/jina.py git diff --checkTest Result
SPDX, forbidden-import, and configuration checks.
f355f21e03004acfc86af056b3610282290563ab563dd5f9d04e5768bca06688.[768]and L2 norm1.0.lm_head, confirming the tied input embedding was not removed.c740490981d58e61cee407638b98c0ad724674e11341bc94086a7fa19a675942.[1024]and L2 norm1.0.